#ifndef _TAG_TYPE_H_
#define _TAG_TYPE_H_

#include <stdint.h>

//低频卡标识
#define TAG_TYPE_LF		0x40
//高频卡标识
#define TAG_TYPE_HF		0x80

#define TAG_MASK(tag)				(1u << (tag))
#define TAG_FLAG_SET(flag, tag)		do{flag |= TAG_MASK(tag); }while(0)
#define TAG_FLAG_CLR(flag, tag)		do{flag &= ~ TAG_MASK(tag); }while(0)
#define TAG_FLAG_CHECK(flag, mask)	(((flag) & (mask)) !=0 )
#define TAG_CODE(type, mask)		((type) | (mask))

//低频卡
#define TAG_EM4102 		0x00
#define TAG_HITAG1S 	0x01
#define TAG_HITAG2 		0x02
#define TAG_EM4150 		0x03
#define TAG_AT5555 		0x04
#define TAG_ISOFDX 		0x05
#define TAG_EM4026 		0x06
#define TAG_HITAGU 		0x07
#define TAG_EM4305 		0x08
#define TAG_HIDPROX 	0x09
#define TAG_TIRIS 		0x0A
#define TAG_COTAG 		0x0B
#define TAG_IOPROX 		0x0C
#define TAG_INDITAG 	0x0D
#define TAG_HONEYTAG 	0x0E
#define TAG_AWID 		0x0F
#define TAG_GPROX 		0x10
#define TAG_PYRAMID 	0x11
#define TAG_KERI 		0x12
#define TAG_DEISTER 	0x13
#define TAG_CARDAX 		0x14
#define TAG_NEDAP 		0x15
#define TAG_PAC 		0x16
#define TAG_IDTECK 		0x17
#define TAG_ULTRAPROX 	0x18
#define TAG_ICT 		0x19
#define TAG_ISONAS 		0x1A
//高频卡
#define TAG_MIFARE 		0x00
#define TAG_ISO14443B 	0x01
#define TAG_ISO15693 	0x02
#define TAG_LEGIC 		0x03
#define TAG_HIDICLASS 	0x04
#define TAG_FELICA 		0x05
#define TAG_SRX 		0x06
#define TAG_NFCP2P 		0x07
#define TAG_BLE 		0x08
#define TAG_TOPAZ 		0x09
#define TAG_CTS 		0x0A
#define TAG_BLELC 		0x0B

#define TAG_WAVELYNX	0x10
#define TAG_SWIFTLANE	0x11
#define TAG_ACCESS_GRID	0x12

//低频卡
#define TAG_MASK_EM4102 	TAG_MASK(0x00)
#define TAG_MASK_HITAG1S 	TAG_MASK(0x01)
#define TAG_MASK_HITAG2 	TAG_MASK(0x02)
#define TAG_MASK_EM4150 	TAG_MASK(0x03)
#define TAG_MASK_AT5555 	TAG_MASK(0x04)
#define TAG_MASK_ISOFDX 	TAG_MASK(0x05)
#define TAG_MASK_EM4026 	TAG_MASK(0x06)
#define TAG_MASK_HITAGU 	TAG_MASK(0x07)
#define TAG_MASK_EM4305 	TAG_MASK(0x08)
#define TAG_MASK_HIDPROX 	TAG_MASK(0x09)
#define TAG_MASK_TIRIS 		TAG_MASK(0x0A)
#define TAG_MASK_COTAG 		TAG_MASK(0x0B)
#define TAG_MASK_IOPROX 	TAG_MASK(0x0C)
#define TAG_MASK_INDITAG 	TAG_MASK(0x0D)
#define TAG_MASK_HONEYTAG 	TAG_MASK(0x0E)
#define TAG_MASK_AWID 		TAG_MASK(0x0F)
#define TAG_MASK_GPROX 		TAG_MASK(0x10)
#define TAG_MASK_PYRAMID 	TAG_MASK(0x11)
#define TAG_MASK_KERI 		TAG_MASK(0x12)
#define TAG_MASK_DEISTER 	TAG_MASK(0x13)
#define TAG_MASK_CARDAX 	TAG_MASK(0x14)
#define TAG_MASK_NEDAP 		TAG_MASK(0x15)
#define TAG_MASK_PAC 		TAG_MASK(0x16)
#define TAG_MASK_IDTECK 	TAG_MASK(0x17)
#define TAG_MASK_ULTRAPROX 	TAG_MASK(0x18)
#define TAG_MASK_ICT 		TAG_MASK(0x19)
#define TAG_MASK_ISONAS 	TAG_MASK(0x1A)

//高频卡
#define TAG_MASK_MIFARE 	TAG_MASK(0x00)
#define TAG_MASK_ISO14443B 	TAG_MASK(0x01)
#define TAG_MASK_ISO15693 	TAG_MASK(0x02)
#define TAG_MASK_LEGIC 		TAG_MASK(0x03)
#define TAG_MASK_HIDICLASS 	TAG_MASK(0x04)
#define TAG_MASK_FELICA 	TAG_MASK(0x05)
#define TAG_MASK_SRX 		TAG_MASK(0x06)
#define TAG_MASK_NFCP2P 	TAG_MASK(0x07)
#define TAG_MASK_BLE 		TAG_MASK(0x08)
#define TAG_MASK_TOPAZ 		TAG_MASK(0x09)
#define TAG_MASK_CTS 		TAG_MASK(0x0A)
#define TAG_MASK_BLELC 		TAG_MASK(0x0B)
#define TAG_MASK_APPLEC 	TAG_MASK(0x0C)

#define TAG_MASK_WAVELYNX	TAG_MASK(TAG_WAVELYNX)
#define TAG_MASK_SWIFTLANE	TAG_MASK(TAG_SWIFTLANE)
#define TAG_MASK_ACCESS_GRID	TAG_MASK(TAG_ACCESS_GRID)


//低频卡
#define LFTAG_EM4102 		0x40
#define LFTAG_HITAG1S 		0x41
#define LFTAG_HITAG2 		0x42
#define LFTAG_EM4150 		0x43
#define LFTAG_AT5555 		0x44
#define LFTAG_ISOFDX 		0x45
#define LFTAG_EM4026 		0x46
#define LFTAG_HITAGU 		0x47
#define LFTAG_EM4305 		0x48
#define LFTAG_HIDPROX 		0x49
#define LFTAG_TIRIS 		0x4A
#define LFTAG_COTAG 		0x4B
#define LFTAG_IOPROX 		0x4C
#define LFTAG_INDITAG 		0x4D
#define LFTAG_HONEYTAG 		0x4E
#define LFTAG_AWID 			0x4F
#define LFTAG_GPROX 		0x50
#define LFTAG_PYRAMID 		0x51
#define LFTAG_KERI 			0x52
#define LFTAG_DEISTER 		0x53
#define LFTAG_CARDAX 		0x54
#define LFTAG_NEDAP 		0x55
#define LFTAG_PAC 			0x56
#define LFTAG_IDTECK 		0x57
#define LFTAG_ULTRAPROX 	0x58
#define LFTAG_ICT 			0x59
#define LFTAG_ISONAS 		0x5A

//高频卡
#define HFTAG_MIFARE 		0x80
#define HFTAG_ISO14443B 	0x81
#define HFTAG_ISO15693 		0x82
#define HFTAG_LEGIC 		0x83
#define HFTAG_HIDICLASS 	0x84
#define HFTAG_FELICA 		0x85
#define HFTAG_SRX 			0x86
#define HFTAG_NFCP2P 		0x87
#define HFTAG_BLE 			0x88
#define HFTAG_TOPAZ 		0x89
#define HFTAG_CTS 			0x8A
#define HFTAG_BLELC 		0x8B

#define HFTAG_ECARD			0x60		//华为电子工牌
//	#define HFTAG_WAVELYNX			0x61
#define HFTAG_CFG			0x63	//配置卡

#define HFTAG_WAVELYNX		0x90	//Wavelynx卡
#define HFTAG_SWIFTLANE		0x91	//Swiftlane卡
#define HFTAG_ACCESS_GRID		0x92	//AccessGrid卡

#define TAG_ID_VALUE(Tag)					(1<<((Tag) & 0x1F))
#define TAG_IS_TRUE(TagTypes, Tag)			(TagTypes & TAG_ID_VALUE(Tag))

//设备支持的卡
#define HFTAG_SUPPORT		(TAG_MASK_FELICA | 		\
							TAG_MASK_MIFARE | 		\
							TAG_MASK_ISO15693 | 	\
							TAG_MASK_ISO14443B | 	\
							TAG_MASK_HIDICLASS | 	\
							TAG_MASK_WAVELYNX	|\
							TAG_MASK_SWIFTLANE	|\
							TAG_MASK_ACCESS_GRID	\
						)
							
#define LFTAG_SUPPORT		( TAG_MASK_EM4102 | TAG_MASK_HIDPROX )

//默认
#define HFTAG_DEFAULT		(TAG_MASK_FELICA | 		\
							TAG_MASK_MIFARE | 		\
							TAG_MASK_ISO15693 | 	\
							TAG_MASK_ISO14443B | 	\
							TAG_MASK_HIDICLASS | 	\
							TAG_MASK_WAVELYNX	\
						)
#define LFTAG_DEFAULT		LFTAG_SUPPORT

typedef struct{
	uint32_t TagTypesLF;
	uint32_t TagTypesHF;
}tagType;

#endif
